package net.sea.study.password.impl;

import cn.hutool.core.util.StrUtil;
import lombok.Data;
import net.sea.study.password.AbstractRule;

/**
 * 非空验证
 */
@Data
public class LengthRule extends AbstractRule {
    private int min;
    private int max;

    @Override
    public boolean doValidate(String password) {
        int length = password.length();
        return length >= min && length <= max;
    }

    @Override
    public int getPriority() {
        return 1;
    }
}
